from django.contrib import admin
from .models import Author, Book, BookInstance, BookRating, BookReview, BookFavorite

@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
    list_display = ('last_name', 'first_name', 'date_of_birth', 'date_of_death', 'avatar', 'intro')
    fields = ['first_name', 'last_name', 'date_of_birth', 'date_of_death', 'avatar', 'intro']

@admin.register(Book)
class BookAdmin(admin.ModelAdmin):
    list_display = ('title', 'author', 'category', 'tags', 'rating', 'like_count', 'favorite_count')
    fields = ['title', 'author', 'summary', 'isbn', 'cover', 'category', 'tags', 'buy_link', 'rating', 'rating_count', 'like_count', 'favorite_count']

admin.site.register(BookInstance)
admin.site.register(BookRating)
admin.site.register(BookReview)
admin.site.register(BookFavorite)
